package com.ruoyi.project.qyxy.plate.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.qyxy.plate.mapper.SgOpenTreeMapper;
import com.ruoyi.project.qyxy.plate.domain.SgOpenTree;
import com.ruoyi.project.qyxy.plate.service.ISgOpenTreeService;

/**
 * 施工企业树形Service业务层处理
 * 
 * @author lcl
 * @date 2021-04-08
 */
@Service
public class SgOpenTreeServiceImpl implements ISgOpenTreeService 
{
    @Autowired
    private SgOpenTreeMapper sgOpenTreeMapper;

    /**
     * 查询施工企业树形
     * 
     * @param id 施工企业树形ID
     * @return 施工企业树形
     */
    @Override
    public SgOpenTree selectSgOpenTreeById(Long id)
    {
        return sgOpenTreeMapper.selectSgOpenTreeById(id);
    }

    /**
     * 查询施工企业树形列表
     * 
     * @param sgOpenTree 施工企业树形
     * @return 施工企业树形
     */
    @Override
    public List<SgOpenTree> selectSgOpenTreeList(SgOpenTree sgOpenTree)
    {
        return sgOpenTreeMapper.selectSgOpenTreeList(sgOpenTree);
    }

    /**
     * 新增施工企业树形
     * 
     * @param sgOpenTree 施工企业树形
     * @return 结果
     */
    @Override
    public int insertSgOpenTree(SgOpenTree sgOpenTree)
    {
        sgOpenTree.setCreateTime(DateUtils.getNowDate());
        return sgOpenTreeMapper.insertSgOpenTree(sgOpenTree);
    }

    /**
     * 修改施工企业树形
     * 
     * @param sgOpenTree 施工企业树形
     * @return 结果
     */
    @Override
    public int updateSgOpenTree(SgOpenTree sgOpenTree)
    {
        sgOpenTree.setUpdateTime(DateUtils.getNowDate());
        return sgOpenTreeMapper.updateSgOpenTree(sgOpenTree);
    }

    /**
     * 批量删除施工企业树形
     * 
     * @param ids 需要删除的施工企业树形ID
     * @return 结果
     */
    @Override
    public int deleteSgOpenTreeByIds(Long[] ids)
    {
        return sgOpenTreeMapper.deleteSgOpenTreeByIds(ids);
    }

    /**
     * 删除施工企业树形信息
     * 
     * @param id 施工企业树形ID
     * @return 结果
     */
    @Override
    public int deleteSgOpenTreeById(Long id)
    {
        return sgOpenTreeMapper.deleteSgOpenTreeById(id);
    }
}
